import {ApiGoods,ApiGoodsRelat} from"@/utils/api.js"
const state = {
	GoodsIndex:'1'
}
const mutations={
		
}
const actions = {
	async actionsGoods({commit},val){
		let res = await ApiGoods(val)
		let rec = await ApiGoodsRelat(val)
		// console.log(rec.data,"1111111")
		uni.setStorageSync("GoodsRelat",JSON.stringify(rec.data.goodsList
))
		state.GoodsIndex=res.data
		uni.navigateTo({
			url:`/pages/Goods/Goods?data=`+JSON.stringify(res.data)
		})
		// uni.redirectTo({
		// 	url:`/pages/Goods/Goods?data=`+JSON.stringify(res.data)
		// })
	}
	}
const getters = {
	
}
export default{
	namespaced:true,
	state,
	mutations,
	actions,
	getters
	
}